import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.*;
import javax.swing.plaf.FontUIResource;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;

public class main_window {
	/**
	 * 统一设置字体，父界面设置之后，所有由父界面进入的子界面都不需要再次设置字体
	 */
	private static void InitGlobalFont(Font font) {
		FontUIResource fontRes = new FontUIResource(font);
		for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements();) {
			Object key = keys.nextElement();
			Object value = UIManager.get(key);
			if (value instanceof FontUIResource) {
				UIManager.put(key, fontRes);
			}
		}
	}
	
	public static void main(String[] args) {
		//美化
		try {
			// 加载主题， 如果要更换主题只需要更改这一行代码
			UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException| UnsupportedLookAndFeelException e) {
				e.printStackTrace();
			}
		
		//设置全局字体
		InitGlobalFont(new Font("幼圆",Font.PLAIN,14));
		
		//创建一个主界面窗口
		final JFrame jf = new JFrame("科学文献管理系统");
		jf.setSize(500,400);
		jf.setLocationRelativeTo(null);
		jf.setResizable(false);
		jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		
		jf.setLayout(new BorderLayout());
		
		JPanel panel_white = new JPanel();
		panel_white.setPreferredSize(new Dimension(500,20));
		JLabel label_white = new JLabel(" ");
		label_white.setFont(new Font(null, Font.PLAIN,20));
		
		JPanel panel_title = new JPanel(new BorderLayout());
		JLabel label1 = new JLabel("  欢迎使用科学文献管理系统");
		label1.setFont(new Font("幼圆",Font.PLAIN,35));
		label1.setPreferredSize(new Dimension(500,100));
		JLabel label_white1 = new JLabel(" ");
		label_white1.setFont(new Font(null,Font.PLAIN,20));
		label_white1.setPreferredSize(new Dimension(700,20));
		JLabel label2 = new JLabel("              请选择你想使用的功能：");
		label2.setFont(new Font("幼圆",Font.PLAIN,20));
		label2.setPreferredSize(new Dimension(500,50));
		panel_title.setPreferredSize(new Dimension(500,200));
		panel_title.add(label1,BorderLayout.NORTH);
		panel_title.add(label2,BorderLayout.SOUTH);
		panel_title.add(label_white1,BorderLayout.CENTER);
		
		JPanel panel_button = new JPanel(new BorderLayout());
		panel_button.setPreferredSize(new Dimension(500,200));
		//创建panel1面板，放置按钮
		JPanel panel1 = new JPanel();
		
		//创建按钮button1，基本搜索
		JButton button1 = new JButton("基本搜索");
		//创建按钮button2，相关搜索
		JButton button2 = new JButton("相关搜索");
		//创建按钮button3，匹配搜索
		JButton button3 = new JButton("作者统计");
		panel1.add(button1);
		panel1.add(button2);
		panel1.add(button3);
		panel1.setPreferredSize(new Dimension(500,100));
		
		JPanel panel2 = new JPanel();
		JButton button4 = new JButton("热点分析");
		JButton button5 = new JButton("部分匹配搜索");
		panel2.add(button4);
		panel2.add(button5);
		panel2.setPreferredSize(new Dimension(500,80));
		
		panel_button.add(panel1,BorderLayout.NORTH);
		panel_button.add(panel2,BorderLayout.SOUTH);
		
		Box vBox = Box.createVerticalBox();
		vBox.add(panel_white);
		vBox.add(panel_title);
		vBox.add(panel_button);
		
		jf.setContentPane(vBox);
		jf.setVisible(true);

		//为button1设置监听,点击时打开新窗口
		button1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				//创建一个新窗口，显示搜索框
				JFrame newJFrame_search_bar = new JFrame("搜索框");
				newJFrame_search_bar.setSize(600,350);
				// 把新窗口的位置设置到主窗口的中心
				newJFrame_search_bar.setLocationRelativeTo(jf);
				// 点击窗口关闭按钮, 执行销毁窗口操作
				newJFrame_search_bar.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
				
				JPanel panel_white = new JPanel();
				JLabel label_white = new JLabel(" ");
				label_white.setFont(new Font(null,Font.PLAIN,15));
				
				//添加文字提示
				JPanel panel_search_bar_title1 = new JPanel();
				JLabel f1_label1 = new JLabel("请输入你想搜索的文章标题：");
				f1_label1.setFont(new Font("幼圆",Font.PLAIN,25));
				//添加搜索框1和按钮
				JPanel panel_search_bar1 = new JPanel();
				JTextField search_bar1 = new JTextField(20);
				JButton f1_btn1 = new JButton("搜索");
				f1_btn1.setFont(new Font("幼圆",Font.PLAIN,14));
				f1_btn1.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						try{my_f1(jf,"基本搜索结果",1,search_bar1.getText());}
						catch(Exception e1) {
							miss_return(jf);
						}
					}
				});
				
				//添加文字提示
				JPanel panel_search_bar_title2 = new JPanel();
				JLabel f1_label2 = new JLabel("请输入你想搜索的作者名：");
				f1_label2.setFont(new Font("幼圆",Font.PLAIN,25));
				//添加搜索框2和按钮
				JPanel panel_search_bar2 = new JPanel();
				JTextField search_bar2 = new JTextField(20);
				JButton f1_btn2 = new JButton("搜索");
				f1_btn2.setFont(new Font("幼圆",Font.PLAIN,14));
				f1_btn2.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						try{my_f1(jf,"基本搜索结果",2,search_bar2.getText());}
						catch(Exception e1) {
							miss_return(jf);
						}
					}
				});
				
				panel_search_bar_title1.add(f1_label1);
				panel_search_bar1.add(search_bar1);
				panel_search_bar1.add(f1_btn1);
				panel_search_bar_title2.add(f1_label2);
				panel_search_bar2.add(search_bar2);
				panel_search_bar2.add(f1_btn2);
				
				
				Box f1_box1 = Box.createVerticalBox();
				f1_box1.add(panel_white);
				f1_box1.add(panel_search_bar_title1);
				f1_box1.add(panel_search_bar1);
				
				f1_box1.add(panel_search_bar_title2);
				f1_box1.add(panel_search_bar2);
				
				newJFrame_search_bar.setContentPane(f1_box1);
				newJFrame_search_bar.setVisible(true);
				
				
				
			}
		});
		
		//为button2设置监听，点击打开新窗口
		button2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				JFrame newJFrame_search_bar = new JFrame("搜索框");
				newJFrame_search_bar.setSize(500,250);
				newJFrame_search_bar.setLocationRelativeTo(jf);
				newJFrame_search_bar.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
				
				JPanel panel_white = new JPanel();
				JLabel label_white = new JLabel(" ");
				label_white.setFont(new Font(null,Font.PLAIN,20));
				
				JPanel panel_search_bar_title = new JPanel();
				JLabel f2_label = new JLabel("请输入你要查找的作者名：");
				f2_label.setFont(new Font("幼圆",Font.PLAIN,25));
				
				JPanel panel_search_bar = new JPanel();
				JTextField search_bar = new JTextField(20);
				JButton f2_btn = new JButton("搜索");
				f2_btn.setFont(new Font("幼圆",Font.PLAIN,14));
				f2_btn.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						String iAuthor = search_bar.getText();
						
						JFrame newJFrame_f2 = new JFrame("相关搜索结果");
						newJFrame_f2.setSize(500,500);
						newJFrame_f2.setResizable(false);
						newJFrame_f2.setLocationRelativeTo(jf);
						newJFrame_f2.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
						newJFrame_f2.setLayout(new BorderLayout());
						
						SearchAbility2 f2_try = new BuildGraph();
						
						JPanel panel_white = new JPanel();
						panel_white.setPreferredSize(new Dimension(500,20));
						JLabel label_white = new JLabel(" ");
						label_white.setFont(new Font(null,Font.PLAIN,20));
						panel_white.add(label_white,BorderLayout.CENTER);
						
						JPanel panel_title = new JPanel();
						panel_title.setPreferredSize(new Dimension(500,100));
						JLabel label = new JLabel("与该作者有合作关系的其他所有作者");
						label.setFont(new Font("幼圆",Font.PLAIN,25));
						panel_title.add(label,BorderLayout.CENTER);
						
						String str = new String();
						try {
							str = f2_try.f2(iAuthor);
							if(str==null) {miss_return(jf);}
						} catch (IOException e1) {
							// TODO 自动生成的 catch 块
						}
						
						JTextArea text_area = new JTextArea(5,10);
						text_area.setLineWrap(true);
						String text = str.replace("[", " ");
						text = text.replace("]", " ");
						text = text.replace(",","\n");
						text = text.trim();
						text_area.setText(text);
						text_area.setFont(new Font(null,Font.PLAIN,15));
						text_area.setSelectionStart(0);
						text_area.setSelectionEnd(0);
						
						JScrollPane scrollPane = new JScrollPane(text_area,
								ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
								ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
						scrollPane.setPreferredSize(new Dimension(500,350));
						
						newJFrame_f2.add(panel_white,BorderLayout.NORTH);
						newJFrame_f2.add(panel_title,BorderLayout.CENTER);
						newJFrame_f2.add(scrollPane,BorderLayout.SOUTH);
						
						newJFrame_f2.setVisible(true);
					}
				});
				panel_search_bar_title.add(f2_label);
				panel_search_bar.add(search_bar);
				panel_search_bar.add(f2_btn);
				
				Box f2_box = Box.createVerticalBox();
				f2_box.add(panel_white);
				f2_box.add(panel_search_bar_title);
				f2_box.add(panel_search_bar);
				
				newJFrame_search_bar.setContentPane(f2_box);
				newJFrame_search_bar.setVisible(true);
			}
		});
		//为button3设置监听，点击打开新窗口
		button3.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				//创建一个窗口，显示发表文章数前一百的作者
				JFrame newJFrame_f3 = new JFrame("发表文章数最多的一百名作者");
				newJFrame_f3.setSize(750,500);
				//设置窗口大小不可改变
				newJFrame_f3.setResizable(false);
				newJFrame_f3.setLocationRelativeTo(jf);
				newJFrame_f3.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
				
				//设置布局方式为BorderLayout
				newJFrame_f3.setLayout(new BorderLayout());
				
				SearchAbility2 f3_try = new BuildGraph();
				
				JPanel panel_white = new JPanel();
				panel_white.setPreferredSize(new Dimension(700,20));
				JLabel label_white = new JLabel(" ");
				label_white.setFont(new Font(null,Font.PLAIN,20));
				panel_white.add(label_white,BorderLayout.CENTER);
				
				JPanel panel_title = new JPanel();
				panel_title.setPreferredSize(new Dimension(700,100));
				JLabel label=new JLabel();
				label.setText("搜索结果");
				label.setFont(new Font("幼圆",Font.PLAIN,30));
				panel_title.add(label,BorderLayout.CENTER);
				
				//将List中的作者和文章数量合并为一组
				List<String> my_list = new ArrayList<String>();
				int m=1;
				try {
					for(int i=0;i<200;) {
						my_list.add(String.valueOf(m)+".  "+f3_try.f3().get(i)+f3_try.f3().get(i+1));
						i=i+2;
						m++;
					}
				} catch (IOException e1) {
					// TODO 自动生成的 catch 块
					e1.printStackTrace();
				}
				
				JTextArea text_area = new JTextArea(5,10);
				text_area.setLineWrap(true);
				text_area.setText("\t\t【】中的数字代表该作者发表的文章数量\n"+String.join("\n",my_list));
				text_area.setFont(new Font(null,Font.PLAIN,15));
				//设置光标在最前面
				text_area.setSelectionStart(0);
				text_area.setSelectionEnd(0);
				
				JScrollPane scrollPane = new JScrollPane(text_area,
						ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
						ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
				scrollPane.setPreferredSize(new Dimension(700,350));
				
				newJFrame_f3.add(panel_white,BorderLayout.NORTH);
				newJFrame_f3.add(panel_title,BorderLayout.CENTER);
				newJFrame_f3.add(scrollPane,BorderLayout.SOUTH);
				
				newJFrame_f3.setVisible(true);
			}
		});
		
		//为button4设置监听，点击打开新窗口
		button4.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				//创建窗口，显示热点分析结果
				JFrame newJFrame_f4 = new JFrame("每年的文章中出现频率前10的单词");
				newJFrame_f4.setSize(750,500);
				//设置窗口大小不可改变
				newJFrame_f4.setResizable(false);
				newJFrame_f4.setLocationRelativeTo(jf);
				newJFrame_f4.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
				newJFrame_f4.setLayout(new BorderLayout());
				
				SearchAbility2 f4_try = new BuildGraph();
				
				JPanel panel_white = new JPanel();
				panel_white.setPreferredSize(new Dimension(700,20));
				JLabel label_white = new JLabel(" ");
				label_white.setFont(new Font(null,Font.PLAIN,20));
				panel_white.add(label_white,BorderLayout.CENTER);
				
				JPanel panel_title = new JPanel();
				panel_title.setPreferredSize(new Dimension(700,100));
				JLabel label=new JLabel();
				label.setText("分析结果");
				label.setFont(new Font("幼圆",Font.PLAIN,30));
				panel_title.add(label,BorderLayout.CENTER);
				
				//将List中的年份和热词列表合为一组
				List<String> my_list = new ArrayList<String>();
				try {
					for(int i=0;i<f4_try.f4().size();) {
						my_list.add(f4_try.f4().get(i)+":   "+f4_try.f4().get(i+1)+"\n");
						i=i+2;
					}
				}
				catch(IOException e1){
					e1.printStackTrace();
				}
				
				JTextArea text_area = new JTextArea(5,10);
				text_area.setLineWrap(true);
				text_area.setText("【年份】\t\t\t【热词频率】\n"+String.join("\n", my_list));
				text_area.setFont(new Font(null,Font.PLAIN,15));
				text_area.setWrapStyleWord(true);
				//设置光标在最前面
				text_area.setSelectionStart(0);
				text_area.setSelectionEnd(0);
				
				JScrollPane scrollPane = new JScrollPane(text_area,
						ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
						ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
				scrollPane.setPreferredSize(new Dimension(700,350));
				
				newJFrame_f4.add(panel_white,BorderLayout.NORTH);
				newJFrame_f4.add(panel_title,BorderLayout.CENTER);
				newJFrame_f4.add(scrollPane,BorderLayout.SOUTH);
				
				newJFrame_f4.setVisible(true);
			}
		});

		//为button5设置监听，大家打开新窗口
		button5.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				//创建一个新窗口，显示搜索框
				JFrame newJFrame_search_bar = new JFrame("搜索框");
				newJFrame_search_bar.setSize(600,200);
				newJFrame_search_bar.setLocationRelativeTo(jf);
				newJFrame_search_bar.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
				
				JPanel panel_white = new JPanel();
				JLabel label_white = new JLabel(" ");
				label_white.setFont(new Font(null,Font.PLAIN,15));
				panel_white.add(label_white);
				
				JPanel panel_search_bar_title = new JPanel();
				JLabel f5_label = new JLabel("请输入你要搜索的关键字");
				f5_label.setFont(new Font("幼圆",Font.PLAIN,25));
				
				JPanel panel_search_bar = new JPanel();
				JTextField search_bar = new JTextField(25);
				search_bar.setText("请使用\",\"分隔关键词");
				JButton f5_button = new JButton("搜索");
				f5_button.setFont(new Font("幼圆",Font.PLAIN,14));
				f5_button.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						List<String> s = new ArrayList<String>();
						s=Arrays.asList(search_bar.getText().split(","));
						SearchAbility f5_try = new ArticlesReader();
						if(f5_try.f5(s)==null) {miss_return(jf);}
						else {
							try {my_f5(jf,"部分匹配搜索结果",s);}
							catch(Exception e1){
								miss_return(jf);
							}
						}
					}
				});
				
				panel_search_bar_title.add(f5_label);
				panel_search_bar.add(search_bar);
				panel_search_bar.add(f5_button);
				
				Box f5_box = Box.createVerticalBox();
				f5_box.add(panel_white);
				f5_box.add(panel_search_bar_title);
				f5_box.add(panel_search_bar);
				
				newJFrame_search_bar.setContentPane(f5_box);
				newJFrame_search_bar.setVisible(true);
			}
		});
	}
	
	public static void my_f1(JFrame relativeWindow,String name,int num,String s) {
		//创建一个新窗口，显示搜索结果
		JFrame newJFrame_f1 = new JFrame(name);
		newJFrame_f1.setSize(750,500);
		//设置窗口大小不可改变
		newJFrame_f1.setResizable(false);
		// 把新窗口的位置设置到 relativeWindow 窗口的中心
		newJFrame_f1.setLocationRelativeTo(relativeWindow);
		// 点击窗口关闭按钮, 执行销毁窗口操作
		newJFrame_f1.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		//设置窗口布局方式为BorderLayout
		newJFrame_f1.setLayout(new BorderLayout());
		
		//调用搜索函数
		SearchAbility f1_try = new ArticlesReader();
		
		//输入完整题目，展示其他信息
		if(num==1) {
			JPanel panel_white = new JPanel();
			panel_white.setPreferredSize(new Dimension(700,20));
			JLabel label_white = new JLabel(" ");
			label_white.setFont(new Font(null,Font.PLAIN,20));
			panel_white.add(label_white,BorderLayout.CENTER);
			
			JPanel panel_title = new JPanel();
			panel_title.setPreferredSize(new Dimension(700,100));
			JLabel label = new JLabel("搜索结果");
			label.setFont(new Font("幼圆",Font.PLAIN,30));
			panel_title.add(label,BorderLayout.CENTER);
			
			//为List中的每个元素附上表头名称
			List<String> my_list = f1_try.f1(1, s);
			for (int i=0;i<my_list.size();i++) {
				if(i%8==0) {my_list.set(i,"【Title】"+" "+my_list.get(i));}
				if(i%8==1) {my_list.set(i, "【Author】"+" "+my_list.get(i));my_list.set(i,my_list.get(i).replace('#', ';'));}
				if(i%8==2) {my_list.set(i, "【Journal】"+" "+my_list.get(i));}
				if(i%8==3) {my_list.set(i, "【Volume】"+" "+my_list.get(i));}
				if(i%8==4) {my_list.set(i, "【Year】"+" "+my_list.get(i));}
				if(i%8==5) {my_list.set(i, "【Month】"+" "+my_list.get(i));}
				if(i%8==6) {my_list.set(i, "【cdrom】"+" "+my_list.get(i));}
				if(i%8==7) {my_list.set(i, "【ee】"+" "+my_list.get(i));}
			}
			
			JTextArea text_area = new JTextArea(5,10);
			text_area.setLineWrap(true);
			text_area.setText(String.join("\n", my_list));
			text_area.setFont(new Font(null,Font.PLAIN,15));
			
			JScrollPane scrollPane = new JScrollPane(text_area,
					ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
	                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
			scrollPane.setPreferredSize(new Dimension(700,350));
			
			newJFrame_f1.add(panel_white,BorderLayout.NORTH);
			newJFrame_f1.add(panel_title,BorderLayout.CENTER);
			newJFrame_f1.add(scrollPane,BorderLayout.SOUTH);
		}
		
		//输入作者名，展示该作者发表的所有论文信息
		if(num==2) {
			JPanel panel_white = new JPanel();
			panel_white.setPreferredSize(new Dimension(700,20));
			JLabel label_white = new JLabel(" ");
			label_white.setFont(new Font(null,Font.PLAIN,20));
			panel_white.add(label_white,BorderLayout.CENTER);
			
			JPanel panel_title = new JPanel();
			panel_title.setPreferredSize(new Dimension(700,100));
			JLabel label = new JLabel("搜索结果");
			label.setFont(new Font("幼圆",Font.PLAIN,30));
			panel_title.add(label,BorderLayout.CENTER);
			
			JTextArea text_area = new JTextArea(5,10);
			text_area.setLineWrap(true);
			text_area.setText(String.join("\n", f1_try.f1(2, s)));
			text_area.setFont(new Font(null,Font.PLAIN,15));
			text_area.setSelectionStart(0);
			text_area.setSelectionEnd(0);
			
			JScrollPane scrollPane = new JScrollPane(text_area,
					ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
	                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
			scrollPane.setPreferredSize(new Dimension(700,350));
			
			newJFrame_f1.add(panel_white,BorderLayout.NORTH);
			newJFrame_f1.add(panel_title,BorderLayout.CENTER);
			newJFrame_f1.add(scrollPane,BorderLayout.SOUTH);
		}
		
		newJFrame_f1.setVisible(true);
	}
	
	public static void my_f5(JFrame relativeWindow,String name,List<String> s) {
		JFrame newJFrame_f5 = new JFrame(name);
		newJFrame_f5.setSize(850,500);
		newJFrame_f5.setResizable(false);
		newJFrame_f5.setLocationRelativeTo(relativeWindow);
		newJFrame_f5.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		newJFrame_f5.setLayout(new BorderLayout());
		
		SearchAbility f5_try = new ArticlesReader();
		
		List<String> my_list = f5_try.f5(s);
		
		JPanel panel_white = new JPanel();
		panel_white.setPreferredSize(new Dimension(700,20));
		JLabel label_white = new JLabel(" ");
		label_white.setFont(new Font(null,Font.PLAIN,20));
		panel_white.add(label_white,BorderLayout.CENTER);
		
		JPanel panel_title = new JPanel();
		panel_title.setPreferredSize(new Dimension(800,100));
		JLabel label = new JLabel("搜索结果");
		label.setFont(new Font("幼圆",Font.PLAIN,30));
		
		panel_title.add(label,BorderLayout.CENTER);
		
		JTextArea text_area = new JTextArea(5,10);
		text_area.setLineWrap(true);
		text_area.setText(String.join("\n",my_list));
		text_area.setWrapStyleWord(true);
		text_area.setSelectionStart(0);
		text_area.setSelectionEnd(0);
		
		JScrollPane scrollPane = new JScrollPane(text_area,
				ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		scrollPane.setPreferredSize(new Dimension(800,350));
		
		
		newJFrame_f5.add(panel_white,BorderLayout.NORTH);
		newJFrame_f5.add(panel_title,BorderLayout.CENTER);
		newJFrame_f5.add(scrollPane,BorderLayout.SOUTH);
		newJFrame_f5.setVisible(true);
	}
	public static void miss_return(JFrame relativeWindow) {
		//创建一个新窗口，提示未搜索到
		JFrame newJFrame_miss = new JFrame("啊哦出错了");
		newJFrame_miss.setSize(500,100);
		// 把新窗口的位置设置到 relativeWindow 窗口的中心
		newJFrame_miss.setLocationRelativeTo(relativeWindow);
		// 点击窗口关闭按钮, 执行销毁窗口操作
		newJFrame_miss.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		
		JPanel panel_white = new JPanel();
		JLabel label_white = new JLabel(" ");
		label_white.setFont(new Font(null,Font.PLAIN,20));
		
		JPanel panel_miss = new JPanel();
		JLabel label_miss = new JLabel("未查找到相应信息，请关闭此窗口后重试");
		label_miss.setFont(new Font("幼圆",Font.PLAIN,20));
		panel_miss.add(label_miss);
		
		Box box_miss = Box.createVerticalBox();
		box_miss.add(panel_white);
		box_miss.add(panel_miss);
		
		
		newJFrame_miss.setContentPane(box_miss);
		newJFrame_miss.setVisible(true);
	}
}
